#define _CRT_SECURE_NO_WARNINGS 1

#include"Heap.h"

void test_Heap()
{
	int a[] = { 156,81,64,32,94,86,97,98,654,98,89,84,98 };
	Heap hp;
	HeapInit(&hp);
	size_t size = sizeof(a) / sizeof(a[0]);
	for (int i = 0; i < size; i++)
	{
		HeapPush(&hp,a[i]);
	}

	for (int i = 0;i< size;i++)
	{
		printf("%d ",hp._a[i]);
	}
	
	printf("\n");

	while(HeapEmpty(&hp) != true)
	{
		printf("%d ",HeapTop(&hp));
		HeapPop(&hp);
	}
	printf("\n");

	HeapDestory(&hp);

	HeapSort(a,size); 
	for (int i = 0; i < size; i++)
		printf("%d ", a[i]);
}

int main()
{
	test_Heap();

	return 0;
}